import React, { useState, useMemo, memo } from 'react'

const MemoSon = React.memo(function Son({ list }) {
  console.log('子组件被重新渲染了')
  return <div>this is span{list}</div>
})

function App() {
  const [count, setCount] = useState(0)
  const list = useMemo(() => {
    return [1, 2, 3]
  }, [])
  return (
    <>
      <MemoSon list={list} />
      <button onClick={() => setCount(count + 1)}>
        change count
      </button>
    </>
  )
}

export default App